
///////////////////////////*公共调用*////////////////////////////////////////////

//录入信息合法性校验
function validateJob()
{   
   if(document.getElementById("PUBSENTM_NAME").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
      alert("请输入舆情名称!");
      document.getElementById("PUBSENTM_NAME").focus();
      return false;
   } 
   if(document.getElementById("PUBSENTM_DETAILS").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
      alert("请输入舆情内容!");
      document.getElementById("PUBSENTM_DETAILS").focus();
      return false;
   } 
   
   if(!checkSection()){alert("请选择下发单位！");return false;}
   return true;
}
function checkSection(){
	var nodes = $.jstree._reference($("#divOrg")).get_checked(-1, true);
	if(nodes.size() > 0){
		var arr = new Array();
		var idx = 0;
		$.each(nodes, function(i, el) {  
			//if($(el).attr("hasChild")=="false"){
				arr[idx] = $(el).attr("id");
				++idx;
			//}
		});
		$("#receive").val(arr);
		return true;
	}else{
		return false;
	}
}
function validateJobaudi()
{   

   if(document.getElementById("audi_details").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
      alert("请输入评阅内容!");
      document.getElementById("audi_details").focus();
      return false;
   } 
   return true;
} 







function validateArchiveInfo()
{ 
   if(document.getElementById("CLASS_ID").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
      alert("请选择所属栏目!");
      document.getElementById("CLASS_ID").focus();
      return false;
   }
   
   if(document.getElementById("TITLE").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
      alert("请输入标题!");
      document.getElementById("TITLE").focus();
      return false;
   }   
   return true;
}


//全选复选框
function checkAll(form){
  var eSource = window.event.srcElement;
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.Name != eSource.name && e.disabled == false)
       e.checked = eSource.checked;
    }
}

//取消全部选复选框
function unselectall(checkBoxID){
	var selectAllObj = document.getElementById(checkBoxID);
    if(selectAllObj.checked){
 		selectAllObj.checked = selectAllObj.checked&0;
    }
}

function selectall(checkBoxID){
	var selectAllObj = document.getElementById(checkBoxID);
    if(selectAllObj.checked){
 		selectAllObj.checked = selectAllObj.checked&1;
    }
}



function displayCtrl(displayElement,hideElement){
	if(displayElement != ""){
		var displayObj = document.getElementById(displayElement);
		displayObj.style.display = "";
	}
	
	if(hideElement != ""){
		var hideObj = document.getElementById(hideElement);
		hideObj.style.display = "none";
	}	
}


///////////////////////////*栏目设置*////////////////////////////////////////////
//删除栏目
function delArticleClassConfirm(){
	//如果用户选择了“取消”，则不执行操作
	if (window.confirm("您确定要删除此栏目吗？删除操作，将同时删除[所有子栏目]，以及所有子栏目内的[所有文章]，请慎重!"))
	{
		return true;
	}

	return false;
}

///////////////////////////*信息管理*////////////////////////////////////////////

//[审核]审核所选
function auditMoreFromSelected(form){
	if (! window.confirm("您确定要审核通过所选的档案信息吗")){
		return;
	}
	form.action = "archiveAuditMore.action";
	form.submit();
}

//[信息管理]删除所选
function delAllSelected(form){
	if (! window.confirm("您确定要删除所选信息吗？")){
		return;
	}
	form.action = "archiveInfoDeleteMore.action";
	form.submit();
}

//[信息管理]移动信息
function moveArchiveInfo(form){
	
   if(document.getElementById("newClassId").value.replace(/(^\s*)|(\s*$)/g,"").length==0)
   {
		alert("请选择要移动的栏目!");
		document.getElementById("newClassId").focus();
		return false;
   }else{
		if (! window.confirm("您确定要移动选定的信息吗？")){
			return;
		}
		form.action = "archiveInfoMove.action";
		form.submit();
   }
   return true;
}

//[回收站]还原所有
function resumeAllFromRecycleBin(form){
	if (! window.confirm("您确定要从回收站中恢复所有信息吗?")){
		return;
	}
	
	form.action = "archiveRecyclebinResumeAll.action";
	form.submit();
}

//[回收站]还原所选
function resumeAllSelectedFromRecycleBin(form){
	if (! window.confirm("您确要定从回收站中恢复所选信息吗？")){
		return;
	}
	
	form.action = "archiveRecyclebinResumeAllSelected.action";
	form.submit();
}

//[回收站]删除所选
function delAllSelectedFromRecycleBin(form){
	if (! window.confirm("您确定要从回收站中彻底删除所选信息吗？")){
		return;
	}
	
	form.action = "archiveRecyclebinDelAllSelected.action";
	form.submit();
}

//[回收站]删除全部（清空回收站）
function delAllFromRecycleBin(form){
	if (! window.confirm("您确定要清空回收站中所有信息吗？")){
		return;
	}
	
	form.action = "archiveRecyclebinDelAll.action";
	form.submit();
}




















